import java.io.*;
import java.util.*;

import javax.media.opengl.GL;
import javax.media.opengl.glu.GLU;

/**
 * @author Eric Muehlberg
 *
 */
public class Map
{

	ArrayList<WObject> mapobjects;
	
	public Map(String filename) throws IOException
	{
		mapobjects = new ArrayList<WObject>();
		mapobjects.clear();
		
		//Generate Map from file
		
		BufferedReader r = new BufferedReader(new FileReader(filename));
		StringTokenizer s;
		while(r.ready())
		{
			s = new StringTokenizer(r.readLine());
			if(s.toString().contains("//"))
				continue;
			
			while(s.hasMoreTokens())
			{
				String str = s.nextToken();
				//Only case for cube currently
				if(str.equals("cube"))
				{
					int x = Integer.parseInt(s.nextToken());
					int y = Integer.parseInt(s.nextToken());
					int z = Integer.parseInt(s.nextToken());
					int w = Integer.parseInt(s.nextToken());
					int h = Integer.parseInt(s.nextToken());
					int d = Integer.parseInt(s.nextToken());

					String modelfile = s.nextToken().toString();					
					mapobjects.add(new ObjectThree(x,y,z,w,h,d,str,modelfile));
				}
			}
		}
		
		
	}
	
}
